test(parse): wrap unit tests of symmetric definition parsing in mod tests#23
Merged
hyperfinitism merged 1 commit intomainfrom Mar 28, 2026
Merged
test(parse): wrap unit tests of symmetric definition parsing in mod tests#23hyperfinitism merged 1 commit intomainfrom
mod tests#23hyperfinitism merged 1 commit intomainfrom
Conversation
e6e439f to
7d0e11f
Compare
There was a problem hiding this comment.
Pull request overview
This PR reorganizes unit tests in src/parse.rs by moving the symmetric definition parsing #[test] functions under a #[cfg(test)] mod tests module, ensuring test code is excluded from non-test builds while keeping the tests co-located with the parsing logic.
Changes:
- Wrapped existing symmetric definition parsing unit tests into
#[cfg(test)] mod tests. - Added
use super::*;so tests can access module items after being nested.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Code Review
This pull request refactors the test suite in src/parse.rs by wrapping existing unit tests within a dedicated #[cfg(test)] mod tests module, following standard Rust conventions. The reviewer suggested using assert_eq! instead of assert!(matches!(...)) to improve the clarity of error messages when tests fail.
Signed-off-by: Takuma IMAMURA <209989118+hyperfinitism@users.noreply.github.com>
7d0e11f to
2896c38
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR wraps
#[test]functions in#[cfg(test)] mod tests { ... }to follow idiomatic Rust test organisation. This ensures test code is excluded from release builds.